#if !defined(AFX_KTOKENINFO_H__8F870BE1_4948_46DD_9E3A_D2C2CB4D94F9__INCLUDED_)
#define AFX_KTOKENINFO_H__8F870BE1_4948_46DD_9E3A_D2C2CB4D94F9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// KTokenInfo.h : header file
//
#include "SilenceSdbFile.h"
#include "KDcom.h"
#include "KLicenceCode.h"
#include "KReportCtrl.h"
/////////////////////////////////////////////////////////////////////////////
// KTokenInfo dialog
#include "DialogResize.h"
#include "resource.h"
#include "KSFileDialog.h"
#include "KIsReplace.h"
#include "UserPages.h"
#include "Token.h"

extern KDcom theDcom;

//extern KLicenceCode  theLicence[10];

#define  MAXBUF 2000
#include "TokenPages.h"

class KTokenInfo : public CDialogResize
{

// Construction
public:
	void SetPageSize();
	void ShowTokens();
	void ShowTokensCountsInfo();
	
	BOOL m_ifImportExecuting;
	int m_iLicenses;
	CTokenPages m_tokenpages;
	KTokenInfo(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(KTokenInfo)
	enum { IDD = IDD_TOKEN_INFO };
	CStatic	m_cstcProgressBackground;
	CStatic	m_cstcImportProgress;
	CButton	m_cbtnImportTokens;
	CProgressCtrl	m_cprsTokenAdded;
	CEdit	m_cedtSearchText;
	CStatic	m_cstcTokenPagesCnt;
	CEdit	m_cedtTokenPageNo;
	CComboBox	m_cSearchMode;
	KReportCtrl	m_TokenList;
	CString	m_strSearchText;
	//}}AFX_DATA
	CMap<int, int, int, int> m_mapTokenType;	// Map token type to image index.

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(KTokenInfo)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(KTokenInfo)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnClickListToken(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnButtonDisable();
	afx_msg void OnButtonEnable();
	afx_msg void OnBtnRemove();
	afx_msg void OnButtonFind();
	afx_msg void OnButtonImport();
	afx_msg void OnButtonExport();
	afx_msg void OnDblclkListToken(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnBtnGotoFirstTokenPage();
	afx_msg void OnBtnGotoPrevTokenPage();
	afx_msg void OnBtnGotoNextTokenPage();
	afx_msg void OnBtnGotoLastTokenPage();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	DECLARE_DLGRESIZE_MAP;

private:
	int m_iTotalCnt;
	static BOOL CALLBACK EnableCtrl(HWND hwnd, LPARAM lParam);
	static DWORD WINAPI AddTokenThreadProc(KTokenInfo * pDlg);
	static int AddSdb(CSdb<CSilenceMessage> &sdb);
	void ShowFilter();
	CImageList m_ImageList;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_KTOKENINFO_H__8F870BE1_4948_46DD_9E3A_D2C2CB4D94F9__INCLUDED_)
